input {

  stdin {
    type => "appserver"
  }
  file{
    path=> "<%=@logstash_logPath=%>"
    type => "appserver"
    start_position => "beginning"
	sincedb_path => "<%=@logstash_dir=%>/.sincedb"
  }
}
filter{
  if [type] == "appserver" {
      multiline{
        pattern => "%{DATE_CN}"
        negate => true
        what => previous
      }
      grok{
        break_on_match => false
        patterns_dir => "./patterns/webspherePatterns"
        match => ["message", "%{COMMONLOGFORMAT}" ]
        match => ["message", "%{EXCEPTIONLOGFORMAT}"]
      }
    }
    
  }
  output{
    # Send production errors to pagerduty
    stdout { 
    	codec => rubydebug 
    }
    
    if [loglevel] == "ERRORDTL" {
        pagerduty {
          service_key => "47b823edf00a426ebad09a5f164e49d1"
        }
      }
      if [type] == "appserver"{
          redis{
            host => "<%=@logstash_server=%>"
            port => "<%=@logstash_server_port=%>"
            data_type => "list"
            key => "logstash"
            
          }
        }
      }